<?php
require("include/top.php");

if(!empty($_SESSION['sharing']['id'])) {

 $log=basename($_SESSION['sharing']['img_logo']);
	 if(!empty($_SESSION['sharing']['img_logo'])) {
		 $logo=IMG_PATH.'sharing/'.$_SESSION['sharing']['id'].'/'.$log;
		 $tpl->assign('logo',$logo);
	 }
	 if(!empty($_SESSION['sharing']['carrousel'])){
		$tpl->assign('carrousel',$_SESSION['sharing']['carrousel']);
	 }
	 if(!empty($_SESSION['sharing']['img_ban'])) {
		 $ban=IMG_PATH.'sharing/'.$_SESSION['sharing']['id'].'/'.basename($_SESSION['sharing']['img_ban']);
		 $tpl->assign('ban',$ban);
	 }
	 if(!empty($_SESSION['sharing']['box_ban'])) {
		 $bandeau= $_SESSION['sharing']['box_ban'];
		 $tpl->assign('bandeau',$bandeau);
	 }
	 if(!empty($_SESSION['sharing']['img_background'])) {
		 $background=IMG_PATH.'sharing/'.$_SESSION['sharing']['id'].'/'.basename($_SESSION['sharing']['img_background']);
		 $tpl->assign('background',$background);
	 }
	 if(!empty($_SESSION['sharing']['text_home'])){
		$tpl->assign('text_home',$_SESSION['sharing']['text_home']);
	 }
	 
	 if (isset($_POST['submit'])) {
		require(FORM_PATH."personalization.form.php");
	}
		$tpl->display("header.tpl");
		$tpl->display("menu.tpl");
		$tpl->display("personalization.tpl");
		$tpl->display("footer.tpl");
	}
else {header('Location:login.php');}
require("include/bottom.php");
?>